'use strict';
require('./index.css')
require('page/common/nav/index.js')
require('page/common/header/index.js')
var _mm = require('util/mm.js')
var _user = require('service/user-service.js')
var navSide = require('page/common/nav-side/index.js')
var template = require('./index.string')

var page = {
    init : function(){
        this.onLoad()
    },
    onLoad : function(){
        //初始化左侧菜单
        navSide.init({
            name : 'user-center'
        })
        // 加载用户信息
        this.LoadUserInfo()
    },
    //个人中心的信息
    LoadUserInfo : function(){
         var userHtml = ''
        _user.getUserInfo(function(res){
            //成功的时候渲染html
           userHtml = _mm.renderHtml(template,res);
           $('.panel-body').html(userHtml);
        },function(errMsg){
            _mm.errorTips(errMsg)
        })
    }
   
   
}

$(function(){
    page.init()
})

